from PySide6.QtWidgets import QApplication,QStyleFactory,QSplashScreen
from PySide6.QtGui import QPixmap
from PySide6.QtCore import Qt
from auto_choose_them import AutoDark
import sys
import desk_ico_rc
import time

if __name__ == "__main__":
    app = QApplication(sys.argv)
    # 使用支持主题切换的主题
    app.setStyle(QStyleFactory.create("Fusion"))
    
    # 开始动画
    pixmap = QPixmap(":/images/night.png")
    splash = QSplashScreen(pixmap)
    splash.show()
    splash.showMessage("正在初始化，请稍后！",Qt.AlignmentFlag.AlignCenter |Qt.AlignmentFlag.AlignBottom,color="White")  
    time.sleep(0.5)

    auto_them = AutoDark()
    auto_them.show()

    splash.finish(auto_them)
    sys.exit(app.exec())